home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / global / strafing_gunfire.scr < prev    next >
Encoding:
Text File  |  2002-10-21  |  3.9 KB  |  155 lines

  1. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. //
  4. // global/strafing_gunfire.scr
  5. //
  6. // author: Michael Goodwin
  7. //
  8. // description:
  9. //
  10. // - forthcoming
  11. //
  12. // setup:
  13. //
  14. // - place a series of linked info_splinepath entities
  15. // - assign the first info_splinepath entity a unique $targetname
  16. // - call the appropriate script as follows:
  17. //
  18. // - exec global/strafing_gunfire.scr::simple $pathname speed
  19. //
  20. //   - creates a script_simplestrafinggunfine entity that travels
  21. //     along the spline path $pathname and the specified speed
  22. //   - the script_simplestrafinggunfine entity fires shots in the
  23. //     direction of its "down" vector
  24. //
  25. // - exec global/strafing_gunfire.scr::target $pathname speed $target
  26. //
  27. //   - creates a script_aimedstrafinggunfine entity that travels
  28. //     along the spline path $pathname and the specified speed
  29. //   - the script_aimedstrafinggunfine entity fires shots in the
  30. //     direction of the $target object
  31. //
  32. // - exec global/strafing_gunfire.scr::targetpath $pathname speed $targetpathname targetspeed
  33. //
  34. //   - creates a script_aimedstrafinggunfine entity that travels
  35. //     along the spline path $pathname and the specified speed
  36. //   - creates a script_object entity that travels
  37. //     along the spline path $targetpathname and the specified targetspeed
  38. //   - the script_aimedstrafinggunfine entity fires shots in the
  39. //     direction of the script_object entity
  40. //
  41. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. main:
  44. end
  45.  
  46.  
  47. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  49. //
  50. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. simple local.path local.speed:
  53.  
  54.     if ( local.speed == NIL )
  55.     {
  56.         local.speed = 500
  57.     }
  58.  
  59.     if ( local.path != NIL )
  60.     {
  61.         local.emitter = spawn script_simplestrafinggunfire
  62.         local.emitter.origin = local.path.origin
  63.         local.emitter.angles = local.path.angles
  64.         local.emitter on
  65.         local.emitter flypath local.path local.speed 100000 250
  66.         local.emitter thread simple_run
  67.     }
  68.  
  69. end local.emitter
  70.  
  71. simple_run:
  72.  
  73.     self waitmove
  74.     self remove
  75.  
  76. end
  77.  
  78.  
  79. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. //
  82. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84. target local.path local.speed local.target:
  85.  
  86.     if ( local.speed == NIL )
  87.     {
  88.         local.speed = 500
  89.     }
  90.  
  91.     if ( (local.path != NIL) && (local.target != NIL) )
  92.     {
  93.         local.emitter = spawn script_aimedstrafinggunfire
  94.         local.emitter.origin = local.path.origin
  95.         local.emitter.angles = local.path.angles
  96.         local.emitter aimtarget local.target
  97.         local.emitter on
  98.         local.emitter flypath local.path local.speed 100000 250
  99.         local.emitter thread target_run
  100.     }
  101.  
  102. end local.emitter
  103.  
  104. target_run:
  105.  
  106.     self waitmove
  107.     self remove
  108.  
  109. end
  110.  
  111.  
  112. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  113. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114. //
  115. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117. targetpath local.path local.speed local.targpath local.targspeed:
  118.  
  119.     if ( local.speed == NIL )
  120.     {
  121.         local.speed = 500
  122.     }
  123.  
  124.     if ( local.targspeed == NIL )
  125.     {
  126.         local.targspeed = 500
  127.     }
  128.  
  129.     if ( (local.path != NIL) && (local.targpath != NIL) )
  130.     {
  131.         local.target = spawn script_object
  132.         local.target.origin = local.targpath.origin
  133.         local.target.angles = local.targpath.angles
  134.         local.target flypath local.targpath local.targspeed 100000 250
  135.         local.target move
  136.  
  137.         local.emitter = spawn script_aimedstrafinggunfire
  138.         local.emitter.origin = local.path.origin
  139.         local.emitter.angles = local.path.angles
  140.         local.emitter aimtarget local.target
  141.         local.emitter on
  142.         local.emitter flypath local.path local.speed 100000 250
  143.         local.emitter thread targetpath_run local.target
  144.     }
  145.  
  146. end local.emitter
  147.  
  148. targetpath_run local.target:
  149.  
  150.     self waitmove
  151.     self remove
  152.     local.target remove
  153.  
  154. end
  155.